<html>
  <head>
    <script type="application/javascript">
      function draw() {
        var canvas = document.getElementById("canvas");
        if (canvas.getContext) {
          var ctx = canvas.getContext("2d");
          // 开始绘制路径图形
          ctx.beginPath();
          ctx.arc(75, 75, 50, 0, Math.PI * 2, false);

          // 填充颜色
          ctx.fillStyle = "yellow";
          ctx.fill();
          // 画出边框
          ctx.stroke();
        }
      }
    </script>
    <style type="text/css">
        canvas {
            border: 1px solid black;
        }
    </style>
  </head>
  <body onload="draw();">
    <canvas id="canvas" width="150" height="150"></canvas>
  </body>
</html>